<div class="span10" style="background: #fff;margin-left: 2px;">
<table width="100%" style="margin: 0;padding: 0;" id="_content">
    <tr>
        <td class="hzbar"></td>
        <td style="padding: 10px 15px;" valign="top">
<?php echo $this->session->flashdata('_message'); ?>
<!-- Modal Form -->
<?php echo $action; ?>
<?php echo anchor('administrator/shop/promotion/create','<i class="icon-plus"></i>Add new promotion','class="btn"'); ?>
<div style="margin-bottom: 15px;"></div>
<?php
if(!empty($promotions)){
?>
    <table class="table table-striped table-bordered table-condensed">
        <tr>
            <td>Id</td>
            <td>Code</td>
            <td>Discount</td>
            <td>Start date</td>
            <td>End date</td>
        </tr>
        <?php 
            foreach($promotions as $prom):
        ?>
        <tr>
            <td><?php echo  $prom->promotion_id ?></td>
            <td><?php echo $prom->discount ?></td>
            <td><?php echo $prom->promotion_code ?></td>
            <td><?php echo date('d/m/Y',$prom->startdate) ?></td>
            <td><?php echo date('d/m/Y',$prom->enddate) ?></td>
            <td>
                <?php
                if($prom->actived)
                {
                     echo anchor('administrator/shop/promotion/unactived/'.$prom->promotion_id,'<i class="icon-remove"></i> UnActive', 'class="btn action" onclick="return confirm(\'Do you want to  unactive this promotion?\')"');
                }
                else
                     echo anchor('administrator/shop/promotion/actived/'.$prom->promotion_id,'<i class="icon-remove"></i> Active', 'class="btn action" onclick="return confirm(\'Do you want to active this promotion?\')"')
                      ?>
            </td>
            <td>
            <?php echo anchor('administrator/shop/promotion/edit/'.$prom->promotion_id,'<i class="icon-edit"></i> Edit', 'class="btn action"') ?>
            </td>
            <td>
<?php echo anchor('administrator/shop/promotion/delete/'.$prom->promotion_id,'<i class="icon-remove"></i> Delete', 'class="btn action" onclick="return confirm(\'Do you want to delete this Promotion?\')"') ?>
            </td>
        </tr>
        <?php endforeach; ?>
    </table>
<?php
}else{
    echo '<div class="alert alert-info"><h4 class="alert-heading">Thông báo!</h4>Chưa có khuyến mãi nào...</div>';
}
?></td></tr></table>
</div>